using System;
using System.Data.SqlClient;
namespace SS
{
	public class GProduct
	{
		private Func objFun = new Func();
		public string GetValue(string _FiledN, string _TableName, string _Key, string _KeyValue)
		{
			string result = string.Empty;
			SqlConnection sqlConnection = new SqlConnection(this.objFun.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand(string.Concat(new string[]
			{
				"SELECT * FROM ",
				_TableName,
				" WHERE ",
				_Key,
				" = '",
				_KeyValue,
				"'"
			}), sqlConnection);
			sqlConnection.Open();
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					result = sqlDataReader["" + _FiledN + ""].ToString();
				}
			}
			sqlDataReader.Close();
			sqlDataReader.Dispose();
			sqlConnection.Close();
			sqlConnection.Dispose();
			return result;
		}
	}
}
